package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseSupplier;

import java.io.File;
import java.util.List;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseSupplierService extends BaseService<PurchaseSupplier> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseSupplier
     * @return
     */
    IPage<PurchaseSupplier> list(IPage<PurchaseSupplier> page, PurchaseSupplier purchaseSupplier);

    /**
     * 查询数据库供应商信息（如果缺少则新增）
     *
     * @param supplier
     * @return
     */
    PurchaseSupplier validPurchaseSupplier(PurchaseSupplier supplier);

    /**
     * 删除供应商信息
     *
     * @param ids
     */
    void deleteSuppliers(List<Long> ids);

    /**
     * 导出供应商详情
     * @param supplierId
     * @param startDate
     * @param endDate
     * @return
     */
    File exportDetail(Long supplierId, String startDate, String endDate);

    /**
     * 合并同名厂家
     * @return
     */
    boolean mergeSupplier();

    /**
     * 替换厂家id
     * @param oid 被替换值
     * @param nid 目标值
     */
    void replaceSupplierId(Long oid, Long nid);

    /**
     * 替换供应商
     * @param oids
     * @param nid
     */
    void replaceSuppliers(List<Long> oids, Long nid);
}
